package org.gpp.proj1.communication.protocol;

import java.io.Serializable;
import java.util.Arrays;

public class Message implements Serializable{

	private static final long serialVersionUID = -525569849333513915L;
	private ProtocolIdentifiers identifier;
	private String senderId;
	private String[] parameters;
	
	public Message( ProtocolIdentifiers identifier, String[] parameters ) {
		
		this.identifier = identifier;
		this.senderId = null;
		this.parameters = parameters;
	}

	public ProtocolIdentifiers getIdentifier() {
		return identifier;
	}

	public String[] getParameters() {
		return parameters;
	}

	public String getSenderId() {
		return senderId;
	}
	
	public void setSenderId( String senderId ) {
		this.senderId = senderId;
	}

	@Override
	public String toString() {
		
		return "[" + identifier.name() + " | " + this.senderId + " | " + Arrays.toString( parameters ) + " ]";
	}
}
